package kr.hkit.powerjava.chapter20;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ArraysEx {
	public static void main(String[] args) {
		ArrayList<Integer> arrayList = new ArrayList<>();
		for (int i = 1; i < 11; i++) {
			arrayList.add(i);

		}
		for (int a : arrayList) {

			System.out.printf("%-3d", a);
		}
		System.out.println();
		for (int a : arrayList) {

			System.out.printf("%3d", a);
		}
		int []arr =new int[10];
		for (int i = 0; i < 10; i++) {
			arr[i]=i+1;
			
		}
		
		List<Integer> list=Arrays.asList(1,2,3,4,5,6,7);
		for (int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
			
		}
		System.out.println();
		//arr
		for(int a:arr){
			System.out.printf("%3d",a);
		}
		System.out.println();
		int idx = Arrays.binarySearch(arr, 11);
		System.out.println("5의 위치는 ?"+idx);

		boolean[] lotto=new boolean[45];
		Arrays.fill(lotto, true);
		for(boolean b: lotto){
			System.out.print(b+" ");
		}
	}


}
